﻿CREATE TABLE [dbo].[Referrals] (
    [Id]              INT           NOT NULL,
    [IdUser]          INT           NOT NULL,
    [IdReferralType]  INT           NOT NULL,
    [ReferralLink]    VARCHAR (MAX) NULL,
    [ClientIPAddress] VARCHAR (15)  NULL,
    [Date]            DATETIME      CONSTRAINT [DF__Table__Date__108B795B] DEFAULT (getdate()) NOT NULL,
    CONSTRAINT [PK__Table__3214EC072547B094] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_Referrals_ReferralTypes] FOREIGN KEY ([IdReferralType]) REFERENCES [dbo].[ReferralTypes] ([Id]),
    CONSTRAINT [FK_Referrals_Users] FOREIGN KEY ([IdUser]) REFERENCES [dbo].[Users] ([Id])
);



